/*
 * Copyright 2011 Clean GWT
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package com.cleangwt.user.client.ui;

import com.cleangwt.uibinder.client.TemplateSupport;
import com.google.gwt.dom.client.Element;

/**
 * A {@link com.google.gwt.user.client.ui.Label} supports element wrapping.
 * 
 * @author Jess
 * @version 1.0
 * @since 1.0
 */
public class Label extends com.google.gwt.user.client.ui.Label {

  /**
   * Creates a label that wraps an existing &lt;div&gt; or &lt;span&gt; element of template.
   * 
   * @param template the template
   * @param element the element to be wrapped
   */
  public static Label wrap(TemplateSupport template, Element element) {
    Label widget = new Label(element);
    template.wrap(widget);
    return widget;
  }

  /**
   * Creates a label.
   */
  public Label() {
  }

  /**
   * Creates a label with the given text.
   * 
   * @param text the text
   */
  public Label(String text) {
    super(text);
  }

  /**
   * This constructor may be used by subclasses to explicitly use an existing element.
   * 
   * @param element the element to be used
   */
  protected Label(Element element) {
    super(element);
  }

}